﻿<UserControl x:Class="LightningTools.BCSTesterMan.View.ErrorView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ViewModel="clr-namespace:LightningTools.BCSTesterMan.ViewModel;assembly=LightningTools.BCSTesterMan.ViewModel" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="572">
	<StackPanel d:DataContext="{d:DesignInstance {x:Type ViewModel:MainWindowViewModel}}">

		<GroupBox Header="Error Message" Margin="8">
			<StackPanel>
				<TextBlock TextWrapping="Wrap" Text="{Binding CurrentError.Message}" Margin="8" />
				<ItemsControl x:Name="ErrorListBox" ItemsSource="{Binding ErrorButtons}" Margin="8">
					<ItemsControl.ItemsPanel>
						<ItemsPanelTemplate>
							<WrapPanel Orientation="Horizontal" />
						</ItemsPanelTemplate>
					</ItemsControl.ItemsPanel>
					<ItemsControl.ItemTemplate>
						<DataTemplate>
							<Button Content="{Binding Path=Name}" Command="{Binding ElementName=ErrorListBox, Path=DataContext.ErrorSearchCommand}" CommandParameter="{Binding}" />
						</DataTemplate>
					</ItemsControl.ItemTemplate>
				</ItemsControl>
			</StackPanel>

		</GroupBox>
		<GroupBox Header="Stacktrace" Margin="8">
			<TextBlock TextWrapping="Wrap" Text="{Binding CurrentError.Stacktrace}" Margin="8" />
		</GroupBox>

	</StackPanel>
</UserControl>